<script lang="ts" setup>
import {  ref, watch } from 'vue'
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
import { useRoute } from 'vue-router'
const route = useRoute()

const breadcrumbList = ref<Array<any>>([])

watch(route,(newVal,oldVal)=>{
    breadcrumbList.value = newVal.matched
},
{
    immediate:true
})
</script>

<template>

        <el-breadcrumb separator="/">
            <el-breadcrumb-item 
              v-for="item in breadcrumbList" 
              :key="item.path"
            >
              {{ item.meta.title }}
            </el-breadcrumb-item>
        </el-breadcrumb>
</template>
